package com.community.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author TangHaoSong Fly ChenJie HeYuHang
 * @since 2024-05-15
 */
@TableName("purchase_order")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PurchaseOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 采购id，主键,自增
     */
    @TableId(value = "purchase_id", type = IdType.AUTO)
    private Integer purchaseId;

    /**
     * 采购订单编号，格式为100+年月日+4位流水号，例如100202304120009
     */
    private String purchaseOrderNumber;

    /**
     * 供应商id
     */
    private Integer supplierId;

    /**
     * 总数量
     */
    private Integer totalAmount;

    /**
     * 总金额
     */
    private Double totalPrice;

    /**
     * 登记人
     */
    private String register;

    /**
     * 登记时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date registerTime;

    /**
     * 审核人
     */
    private String checker;

    /**
     * 审核时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date checkTime;

    /**
     * 审核理由
     */
    private String checkReason;

    /**
     * 审核标志,S001-1（等待审核）、S001-2（审核未通过）、S001-3（审核通过）
     */
    private String checkTag;

    /**
     * 入库标志,K001-1（等待入库）、K001-2（入库失败）、K001-2（入库成功）
     */
    private String gatherTag;

    /**
     * 支付方式，P002-1（余额支付）、P002-2（微信支付）、P003（现金支付）
     */
    private String payMethod;

    /**
     * 配送标志，P001-1（待发货）、P001-2（待收货）、P001-3（已收货）
     */
    private String conveyTag;

    public Integer getPurchaseId() {
        return purchaseId;
    }

    public void setPurchaseId(Integer purchaseId) {
        this.purchaseId = purchaseId;
    }

    public String getPurchaseOrderNumber() {
        return purchaseOrderNumber;
    }

    public void setPurchaseOrderNumber(String purchaseOrderNumber) {
        this.purchaseOrderNumber = purchaseOrderNumber;
    }

    public Integer getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Integer supplierId) {
        this.supplierId = supplierId;
    }

    public Integer getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(Integer totalAmount) {
        this.totalAmount = totalAmount;
    }

    public Double getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(Double totalPrice) {
        this.totalPrice = totalPrice;
    }

    public String getRegister() {
        return register;
    }

    public void setRegister(String register) {
        this.register = register;
    }

    public Date getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(Date registerTime) {
        this.registerTime = registerTime;
    }

    public String getChecker() {
        return checker;
    }

    public void setChecker(String checker) {
        this.checker = checker;
    }

    public Date getCheckTime() {
        return checkTime;
    }

    public void setCheckTime(Date checkTime) {
        this.checkTime = checkTime;
    }

    public String getCheckReason() {
        return checkReason;
    }

    public void setCheckReason(String checkReason) {
        this.checkReason = checkReason;
    }

    public String getCheckTag() {
        return checkTag;
    }

    public void setCheckTag(String checkTag) {
        this.checkTag = checkTag;
    }

    public String getGatherTag() {
        return gatherTag;
    }

    public void setGatherTag(String gatherTag) {
        this.gatherTag = gatherTag;
    }

    public String getPayMethod() {
        return payMethod;
    }

    public void setPayMethod(String payMethod) {
        this.payMethod = payMethod;
    }

    @Override
    public String toString() {
        return "PurchaseOrder{" +
            "purchaseId = " + purchaseId +
            ", purchaseOrderNumber = " + purchaseOrderNumber +
            ", supplierId = " + supplierId +
            ", totalAmount = " + totalAmount +
            ", totalPrice = " + totalPrice +
            ", register = " + register +
            ", registerTime = " + registerTime +
            ", checker = " + checker +
            ", checkTime = " + checkTime +
            ", checkReason = " + checkReason +
            ", checkTag = " + checkTag +
            ", gatherTag = " + gatherTag +
            ", payMethod = " + payMethod +
        "}";
    }
}
